package com.datang.litejvm.clz;

/**
 * @author: 顶风少年
 * @Description: 类访问标志
 * @date: 17:57 2022/6/10
 **/
public class ClassAccessFlag {
    private int flagValue;

    public ClassAccessFlag(int value) {
        this.flagValue = value;
    }

    public int getFlagValue() {
        return flagValue;
    }

    public void setFlagValue(int flag) {
        this.flagValue = flag;
    }

    public boolean isPublic() {
        return (this.flagValue & 0x0001) != 0;
    }

    public boolean isFinal() {
        return (this.flagValue & 0x0010) != 0;
    }

    public boolean isSuper() {
        return (this.flagValue & 0x0020) != 0;
    }

    public boolean isInterface() {
        return (this.flagValue & 0x0200) != 0;
    }

    public boolean isAbstract() {
        return (this.flagValue & 0x0400) != 0;
    }

    public boolean isSynthetic() {
        return (this.flagValue & 0x1000) != 0;
    }

    public boolean isAnnotation() {
        return (this.flagValue & 0x2000) != 0;
    }

    public boolean isEnum() {
        return (this.flagValue & 0x4000) != 0;
    }
}